
#include <stdio.h>
#include <unistd.h>
#include "dual_light.h"

static void TestCallback(DualLight* dl, int32_t light1, int32_t light2)
{
    fprintf(stdout, "===== %s == %s =====\r", light1 ? "@@" : "--", light2 ? "@@" : "--");
    fflush(stdout);
}

/*
 *  ./out [type: 0,1,2,3,...]
 */
int main(int argc, char** argv)
{
    int intervalMs = 100;

    DualLight dl = {0};
    dl.callback = &TestCallback;
    dl.type = argc > 1 ? atoi(argv[1]) : 0;

    while(1)
    {
        duallight_driver(&dl, intervalMs);
        usleep(intervalMs * 1000);
    }

    return 0;
}
